package google.com.ImageProcessing;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;

public class ImageProcessingTestActivity extends Activity {
    /** Called when the activity is first created. */	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ImageView lv = (ImageView) findViewById(R.id.imageView1);
        //Canvas canvas = new Canvas(bitmap);
        //mbitmap = emboss(bitmap);
        mbitmap = bitmap;
        mbitmap = emboss(mbitmap);
        lv.setImageBitmap(mbitmap);
    }

    Bitmap bitmap = BitmapFactory.decodeFile("/sdcard/DCIM/100MEDIA/IMAG0049.jpg");
    Bitmap mbitmap;
    public static Bitmap emboss(Bitmap src) {
    	double[][] EmbossConfig = new double[][] {
    		{ -1 ,  0, -1 },
    		{  0 ,  4,  0 },
    		{ -1 ,  0, -1 }
    	};
    	ConvolutionMatrix convMatrix = new ConvolutionMatrix(3);
    	convMatrix.applyConfig(EmbossConfig);
    	convMatrix.Factor = 1;
    	convMatrix.Offset = 127;
    	return ConvolutionMatrix.computeConvolution3x3(src, convMatrix);
    }
}